<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>

<script>

	var nowtime=new Date();
	var hour=nowtime.getHours();
	if((hour>5)&&(hour<=7))
		alert("早上好");
	else if((hour>7)&&(hour<=11))
		alert("上午好");
	else if((hour>11)&&(hour<=13))
		alert("中午好");	
	else if((hour>13)&&(hour<=17))
		alert("下午好");	
	else if((hour>17)&&(hour<=21))
		alert("晚上好");	
	else alert("该休息了");
	
	
	
</script>
		
	</body>
</html>
